<%@ page language="java"  pageEncoding="UTF-8"%>
<%@ include file="/inc/tag.inc"%>
<%@ include file="/inc/constants.inc"%>
<%@ include file="/inc/script.inc"%>
<%@ include file="/inc/style.inc"%>
<%-- Success Messages --%>
<logic:messagesPresent message="true">
	<script type="text/javascript">
	var message="<html:messages id='message' message='true'>${message}</html:messages>";
	message=message.replace(new RegExp("<br>","gm"),"\n");
	HideProgressInfo(true);
	alert(message);
	</script>
</logic:messagesPresent>
<c:if test="${requestScope.cb=='yes'}">
<script type="text/javascript">
	try{
		window.returnValue = "succes";
		window.close();
	}catch(e){
	}
</script>
</c:if> 
<html>
<head>
    <title>分市场设置新增</title>
</head>
<body class="backcor">
	<div class="info00">
		<div class="info01">
			<html:form action="/${actionpath}/jyFscszAction">
				<html:hidden property="method" value="save"/>
			    <fieldset>
			    	<legend>主要信息</legend>
					<table align="center">
						<tr>
							<td align="right">市场名称</td>
							<td>
								<html:text property="mc" maxlength="50" value="${model.mc}" styleClass="text" onblur="javascript:ontextblur(this)" onfocus="javascript:ontextfocus(this)" size="40"/> 
							</td>
						</tr>
						<tr>
							<td align="right">市场代码</td>
							<td>
								<html:text property="dm" maxlength="250" value="${model.dm}" styleClass="text" onblur="javascript:ontextblur(this)" onfocus="javascript:ontextfocus(this)" size="40"/> 
							</td>
						</tr>
						<tr>
							<td align="right">市场域名</td>
							<td>
								<html:text property="ym" maxlength="50" value="${model.ym}" styleClass="text" onblur="javascript:ontextblur(this)" onfocus="javascript:ontextfocus(this)" size="40"/> 
							</td>
						</tr>
						<tr>
							<td align="right">BSP频道代码</td>
							<td>
								<html:text property="pddm" maxlength="250" value="${model.pddm}" styleClass="text" onblur="javascript:ontextblur(this)" onfocus="javascript:ontextfocus(this)" size="40"/> 
							</td>
						</tr>
						<tr>
							<td align="right">是否在总市场显示</td>
							<td>
								<html:select styleClass="select" property="bz" >
									<option value="1">是</option>
									<option value="0">否</option>
								</html:select> 
							</td>
						</tr>
					</table>
				</fieldset>
				<div class="operate01">
					<input name="save" class="button" type="button" onclick="javascript:saveSub();" value="保 存" />
					<input name="cancel" class="button" type="button" onclick="javascript:cancelSub();" value="关 闭" />
				</div>
			</html:form>
		</div>
	</div>
</body>
<script type="text/javascript" language="javascript">
	/**------------------------------------------
	//@Author    :guanweichen
	//@CreateDate:2010-11-18
	//@Deprecated:关闭
	-------------------------------------------**/
	function cancelSub(){
		window.returnValue = "succes";
		window.close();
	}
	/**------------------------------------------
	//@Author    :guanweichen
	//@CreateDate:2010-11-18
	//@Deprecated:关闭
	-------------------------------------------**/
	function saveSub(){
		if(checkValue()){
			jyFscszForm.method.value = "save";
			jyFscszForm.submit();
			ShowProgressInfo("保存设置,请稍等...",true);
		}
	}
	
	/**------------------------------------------
	//@Author    :guanweichen
	//@CreateDate:2010-11-18
	//@Deprecated:验证数据
	-------------------------------------------**/
	function checkValue(){
		var name = $F('mc');
		var code = $F('dm');
		var area = $F('ym');
		var pdCode = $F('pddm');
		var bz = $F('bz');
		if(null == name || name == "" || name.length <1){
			alert("市场名称请填写完整！");
			jyFscszForm.mc.focus();
			return	false;
		}
		if(null == code || code == "" || code.length <1){
			alert("市场代码请填写完整！");
			jyFscszForm.mc.focus();
			return	false;
		}
		if(null == area || area == "" || area.length <1){
			alert("市场域名请填写完整！");
			jyFscszForm.mc.focus();
			return	false;
		}
		if(null == pdCode || pdCode == "" || pdCode.length <1){
			alert("BSP频道代码请填写完整！");
			jyFscszForm.mc.focus();
			return	false;
		}
		//判断空格和非法字符，如果有则返回false，清空输入框。
	    if(!checkTextinput(name)) {    
			jyFscszForm.mc.focus();
	        return false;    
	    }
		//判断空格和非法字符，如果有则返回false，清空输入框。
	    if(!checkTextinput(code)) {    
			jyFscszForm.dm.focus();
	        return false;    
	    }
	  //判断空格和非法字符，如果有则返回false，清空输入框。
	    if(!checkTextinput(area)) {    
			jyFscszForm.ym.focus();
	        return false;    
	    }
	  //判断空格和非法字符，如果有则返回false，清空输入框。
	    if(!checkTextinput(pdCode)) {    
			jyFscszForm.pddm.focus();
	        return false;    
	    }
		return	true;
	}
</script>
</html>